/*
 * @Descripttion: 
 * @version: 
 * @Author: ydj
 * @Date: 2025-04-09 10:34:43
 * @LastEditors: ydj
 * @LastEditTime: 2025-04-10 11:22:16
 */
import React from 'react';
import { Routes, Route, useLocation } from 'react-router-dom';
import './App.css';
import TabBar from './components/TabBar/tabBar.tsx';
import HomePage from './pages/HomePage/HomePage.tsx';
import CityList from './pages/CityList/cityList.tsx';



function App() {
  const location = useLocation();
  // 根据路由确定当前激活的tab
  const activeTab = location.pathname === '/city-list' ? 'city' : 'home';

  return (
    <div id="#root">
      <div className="app-container">
        {/* 主要内容区域 */}
        <div className="content">
          <Routes>
            <Route path="/" element={<HomePage />} />
          </Routes>
          <Routes>
            <Route path="/city-list" element={<CityList />} />
          </Routes>
        </div>

        {/* 底部TabBar */}
        <TabBar activeTab={activeTab} />
      </div>
    </div>
  )
}

export default App
